<template>
  <div class="father">
    <h3>父组件</h3>
    <div class="content">
      <!-- <Game v-slot:list="slotProps">
        <ul>
          <li v-for="item in slotProps.games" :key="item.name">
            {{ item.name }}
          </li>
        </ul>
      </Game> -->
      <!-- 作用域插槽 slotProps是个对象，儿子提供数据，父亲负责展示 -->
      <Game>
        <template #default="slotProps">
          <ul>
            <li v-for="item in slotProps.games" :key="item.name">
              {{ item.name }}
            </li>
          </ul>
        </template>
      </Game>
      <!-- <Game></Game>
      <Game></Game> -->
    </div>
  </div>
</template>

<script setup lang="ts" name="Father">
import Game from "./Game.vue";
</script>

<style scoped>
.father {
  background-color: rgb(165, 164, 164);
  padding: 20px;
  border-radius: 10px;
}
.content {
  display: flex;
  justify-content: space-evenly;
}
</style>
